#ifndef _Dealer
#define _Dealer

#include <QApplication>
#include <iostream>
#include <sstream>
#include <string>
#include <QtGui>
#include <map>

#include "../Common/Player.h"
#include "../Common/Exception.h"
#include "../Common/NetWorkInterface.h"
#include "../Common/GameInfo.h"
#include "../Common/PokerTool.h"

class GameInfo;
class QtApp;
class Player;
class Exception;
class Game;

using namespace std;

class Dealer
{
	public:

		// nombre de partie ou l'on distribue les mêmes cards /
		int compteurDePartie ;
		int nbPartieAvantNouvelleDistribution;
		bool isDistribute;

		// souvenir des Card précédement joué /
		std::map<int, Card> cards;
		std::map <int,Player> playerMemory;

		Dealer();
		bool isDelivering();

		std::map <int,Player> runGame(string ipj1,string ipj2,string port1,string iport2,int s1,int s2,string strategy1,string strategy2);
		std::map <int,Card> initCards();
		void distributionFlop(Player & player1, Player & player2);
		void distribution4(Player & player1, Player & player2);
		void distribution5(Player & player1, Player & player2);
		//void distributionPreFlop(Player & player1, Player & player2);
		void distriblind(Player & player1, Player & player2);
		void printCards(map <int,Card> &cards);
		virtual void distribution(Player & player1, Player & player2){player1=player2;}//=0;
		~Dealer();
		void reversePlayer(Player &player1, Player &player2);
};

#endif
